package com.peaw.ccb.controller.annotation;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import test.java.poi.PoiTest;

@Controller
public class DianziduizhangController {
	
	private Logger log = LoggerFactory.getLogger(getClass());
	
	@RequestMapping("/F6A0210")
	public ModelAndView getF6A0210(@RequestParam("startDate")String startDate) {
		ModelAndView mv = new ModelAndView("F6A0210"); //电子对账明细账查询
		try {
			String xlsxDir = "D:/ccb/data/duizhangmingxi/";
			String filename = startDate.substring(0,6) + ".xlsx";
			List<Map<String, String>> all = PoiTest.read2(xlsxDir + filename);
			mv.addObject("list", all);
		} catch (Exception e) {
			e.printStackTrace();
		}
		log.info(mv.toString());		
		return mv;
	}

}
